-- GENERATED SPELL FOR [Apprentice Star Scryer] --


function spell0_20043(pUnit, Event) --@Arcane Buffet,n/a--
pUnit:FullCastSpellOnTarget(37133,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20043', 20302, 1)
end

function spell1_20043(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(38725,pUnit)
pUnit:RegisterEvent('Sorts_20043', 681, 1)
end

function spell2_20043(pUnit, Event) --@Arcane Shock,n/a--
pUnit:FullCastSpellOnTarget(37132,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20043', 12000, 1)
end

function spell3_20043(pUnit, Event) --@Arcane Volley,n/a--
pUnit:FullCastSpellOnTarget(37129,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20043', 553, 1)
end

function Sorts_20043(pUnit, Event)
local choix_sorts_20043 = math.random(0, 3)
if choix_sorts_20043 == 0 then
pUnit:RegisterEvent('spell0_20043', 1, 1)
end
if choix_sorts_20043 == 1 then
pUnit:RegisterEvent('spell1_20043', 1, 1)
end
if choix_sorts_20043 == 2 then
pUnit:RegisterEvent('spell2_20043', 1, 1)
end
if choix_sorts_20043 == 3 then
pUnit:RegisterEvent('spell3_20043', 1, 1)
end
end

function mob20043_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20043', math.random(1500, 3000), 1)
end

function mob20043_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20043_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20043_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20043, 1, 'mob20043_Action')
RegisterUnitEvent(20043, 2, 'mob20043_Leave')
RegisterUnitEvent(20043, 3, 'mob20043_Kill')
RegisterUnitEvent(20043, 4, 'mob20043_Die')
